<!--
 Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head>
    <title>Welcome to DayTrader</title>
    <link rel="stylesheet" href="style.css" type="text/css" />
</h:head>
<h:body bgcolor="#ffffff" link="#000099" vlink="#000099">
<h:form>
<table height="54">
    <tbody>
        <tr>
            <td bgcolor="#c93333" align="left" width="640" height="10" colspan="5"><b><font
                color="#ffffff">DayTrader Home</font></b></td>
            <td align="center" bgcolor="#000000" width="100" height="10"><font
                color="#ffffff"><b>DayTrader</b></font></td>
        </tr>
        <tr align="left">
           <td><b><h:outputLink value="tradehome.faces">Home</h:outputLink></b><b> </b></td>
            <td><b><h:outputLink value="account.faces">Account</h:outputLink></b><b> </b></td>
            <td><b><h:outputLink value="portfolio.faces">Portfolio</h:outputLink></b><b> </b></td>
            <td><b><h:outputLink value="quote.faces">Quotes/Trade</h:outputLink></b></td>
            <td><b><h:commandLink action="#{tradeapp.logout}">Logoff</h:commandLink></b></td>
            <td></td>
        </tr>
        <tr>
            <td align="right" colspan="6">
            <hr/>
            <font color="#ff0000" size="-2"><h:outputLabel value="#{accountdata.currentTime}" color="#ff0000" /></font></td>
        </tr>
     
        <tr>
            <td colspan="6" bgcolor="#ff0000"><blink><b><font color="#ffffff">Alert:
            The following Order(s) have completed.</font></b></blink></td>
        </tr>
        <tr align="center">
            <td colspan="6">
            <h:dataTable id="orders" value="#{accountdata.closedOrders}" var="item" border="1">
            <f:facet name="header">
                <h:outputText value="Alert: The following Order(s) have completed."
                    color="#ff0000" />
            </f:facet>

            <h:column>
                <f:facet name="header">
                    <h:outputText value="order id" />
                </f:facet>
                <h:outputText value="#{item.orderID}"></h:outputText>
            </h:column>

            <h:column>
                <f:facet name="header">
                    <h:outputText value="order status" />
                </f:facet>
                <h:outputText value="#{item.orderStatus}"></h:outputText>
            </h:column>

            <h:column>
                <f:facet name="header">
                    <h:outputText value="creation date" />
                </f:facet>
                <h:outputText value="#{item.openDate}"></h:outputText>
            </h:column>

            <h:column>
                <f:facet name="header">
                    <h:outputText value="completion date" />
                </f:facet>
                <h:outputText value="#{item.completionDate}"></h:outputText>
            </h:column>

            <h:column>
                <f:facet name="header">
                    <h:outputText value="txn fee" />
                </f:facet>
                <h:outputText value="#{item.orderFee}"></h:outputText>
            </h:column>

            <h:column>
                <f:facet name="header">
                    <h:outputText value="type" />
                </f:facet>
                <h:outputText value="#{item.orderType}"></h:outputText>
            </h:column>

            <h:column>
                <f:facet name="header">
                    <h:outputText value="symbol" />
                </f:facet>
                <h:outputText value="#{item.symbol}"></h:outputText>
            </h:column>

            <h:column>
                <f:facet name="header">
                    <h:outputText value="quantity" />
                </f:facet>
                <h:outputText value="#{item.quantity}"></h:outputText>
            </h:column>
        </h:dataTable>
            </td>
        </tr>
    
    </tbody>
</table>
<table width="636">
    <tbody>
        <tr>
            <td valign="top" width="377">
            <table width="384">
                <tbody>
                    <tr>
                        <td colspan="3"><b>Welcome &nbsp;<h:outputLabel value="#{accountdata.profileID}" />,</b></td>
                    </tr>
                    <tr>
                        <td width="133"></td>
                        <td width="22"></td>
                        <td width="212"></td>
                    </tr>
                    <tr>
                        <td colspan="3" align="left" bgcolor="#cccccc"><b> User Statistics
                        </b></td>
                    </tr>
                    <tr>
                        <td align="right" valign="top" width="133"><a
                            href="docs/glossary.html">account ID:<br/>
                        </a><a href="docs/glossary.html">account created:</a><br/>
                        <a href="docs/glossary.html">total logins:</a><br/>
                        <a href="docs/glossary.html">session created:</a><br/>
                        </td>
                        <td width="22"></td>
                        <td align="left" width="212">
                        <h:outputText value="#{accountdata.accountID}" /><br/>
                        <h:outputText value="#{accountdata.creationDate}" /><br/>
                        <h:outputText value="#{accountdata.loginCount}" /><br/>
                        <h:outputText value="#{accountdata.sessionCreationDate}" /><br/>
                        </td>
                    </tr>
                    <tr>
                        <td width="133"></td>
                        <td width="22"></td>
                        <td width="212"></td>
                    </tr>
                    <tr>
                        <td colspan="3" bgcolor="#cccccc"><b>Account Summary </b></td>
                    </tr>
                    <tr>
                        <td align="right" valign="top" width="133"><a
                            href="docs/glossary.html"> cash balance:</a><br/>
                        <a href="docs/glossary.html">number of holdings:</a><br/>
                        <a href="docs/glossary.html">total of holdings:<br/>
                        sum of cash/holdings<br/>
                        opening balance:<br/>
                        </a>
                        <hr/>
                        </td>
                        <td width="22"></td>
                        <td align="left" valign="top" width="212">$ <h:outputText value="#{accountdata.balance}" /><br/>
                        <h:outputText value="#{accountdata.numberHoldings}" /><br/>
                        $ <h:outputText value="#{accountdata.holdingsTotal}" /><br/>
                        $ <h:outputText value="#{accountdata.sumOfCashHoldings}" /><br/>
                        $ <h:outputText value="#{accountdata.openBalance}" /><br/>

                        <hr/>
                        </td>
                    </tr>
                    <tr>
                        <td valign="top" align="right"><a href="docs/glossary.html">current
                        gain/(loss):</a></td>
                        <td></td>
                        <td valign="top">$ <b><h:outputText value="#{accountdata.gain}" /> <h:outputText value="#{accountdata.gainPercent}" /></b></td>
                    </tr>
                </tbody>
            </table>
            </td>
            <td align="center" valign="top" bgcolor="#ffffff" width="236">
            <table border="1" bgcolor="#ffffff" width="100%" style="font-size: smaller">
    <tbody>
        <tr>
            <td colspan="2" bgcolor="#000000" align="center" height="15"><font
                color="#ffffff"><b>Market Summary<br/>
            <h:outputLabel value="#{marketdata.summaryDate}" /></b></font></td>
        </tr>
        <tr>
            <td align="right" bgcolor="#fafcb6" height="47" width="100"><a
                href="docs/glossary.html">DayTrader Stock Index (TSIA)</a></td>
            <td align="center" valign="middle" bgcolor="#ffffff" height="47"
                width="141"><h:outputText value="#{marketdata.TSIA}" /> <h:outputText value="#{marketdata.gainPercent}" /></td>
        </tr>
        <tr>
            <td align="right" bgcolor="#fafcb6"><a href="docs/glossary.html">Trading
            Volume</a></td>
            <td align="center" valign="middle"><h:outputText value="#{marketdata.volume}" /></td>
        </tr>
        <tr>
            <td align="right" bgcolor="#fafcb6" width="74"><a
                href="docs/glossary.html">Top Gainers</a></td>
            <td bgcolor="#ffffff">
           <h:dataTable id="gainers" value="#{marketdata.topGainers}" var="item">
                <h:column>
                    <f:facet name="header">
                        <h:outputText value="symbol" />
                    </f:facet>
                    <h:outputText value="#{item.symbol}"></h:outputText>
                </h:column>
                <h:column>
                    <f:facet name="header">
                        <h:outputText value="price" />
                    </f:facet>
                    <h:outputText value="#{item.price}"></h:outputText>
                </h:column>
                <h:column>
                    <f:facet name="header">
                        <h:outputText value="change" />
                    </f:facet>
                    <h:outputText value="#{item.open}"></h:outputText>
                </h:column>
            </h:dataTable>
            </td>
        </tr>
        <tr>
            <td align="right" height="55" bgcolor="#fafcb6" width="74"><a
                href="docs/glossary.html">Top Losers</a></td>
            <td height="55" bgcolor="#ffffff" width="141">
             <h:dataTable id="losers" value="#{marketdata.topLosers}" var="item">
            <f:facet name="header">
                <h:outputText value="Alert: The following Order(s) have completed."
                    color="#ff0000" />
            </f:facet>

            <h:column>
                <f:facet name="header">
                    <h:outputText value="symbol" />
                </f:facet>
                <h:outputText value="#{item.symbol}"></h:outputText>
            </h:column>
            <h:column>
                <f:facet name="header">
                    <h:outputText value="price" />
                </f:facet>
                <h:outputText value="#{item.price}"></h:outputText>
            </h:column>
            <h:column>
                <f:facet name="header">
                    <h:outputText value="change" />
                </f:facet>
                <h:outputText value="#{item.open}"></h:outputText>
            </h:column>
        </h:dataTable>
            </td>
        </tr>
    </tbody>
</table>
            
             <br/>
            </td>
        </tr>
    </tbody>
</table>
<table height="54" style="font-size: smaller">
    <tbody>
        <tr>
            <td colspan="2">
            <hr/>
            </td>
        </tr>
        <tr>
            <td colspan="2">
            <table width="100%" style="font-size: smaller">
                <tbody>
                    <tr>
                        <td>Note: Click any <a href="docs/glossary.html">symbol</a> for a
                        quote or to trade.</td>
                        <td align="right">
                     <h:commandButton id="submit" type="submit" value="quotes" action="#{quotedata.getQuotesBySymbols}" />
                        <h:inputText id="symbols" value="#{quotedata.symbols}" required="true"><f:validateLength minimum="1" maximum="40" /></h:inputText>
                        </td>
                    </tr>
                </tbody>
            </table>
            </td>
        </tr>
        <tr>
            <td bgcolor="#c93333" align="left" width="640" height="10"><b><font
                color="#ffffff">DayTrader Home</font></b></td>
            <td align="center" bgcolor="#000000" width="100" height="10"><font
                color="#ffffff"><b>DayTrader</b></font></td>
        </tr>
    </tbody>
</table>
</h:form>
</h:body>
</html>
